<%@ page import="com.entry.Goods" %><%--
  Created by IntelliJ IDEA.
  User: dell
  Date: 2021/1/12
  Time: 19:16
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java"  %>
<%@ page import="com.util.PageModel" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <title>商品类别维护</title>
    <script src="../element/vue.js"></script>
    <link rel="stylesheet" href="../element/index.css">
    <script src="../element/index.js"></script>
    <link rel="stylesheet" type="text/css" href="../styles/basc.css">
</head>
<body>
<div id="app">
    <%@ include file="../includes/hear.jsp" %>
    <div class="left">
        <%@ include file="../includes/menu.jsp" %>
    </div>
    <div class="right">
        <div class="operation" style="margin-left: 10px;padding-top: 10px;width: 200px;">验证删除信息↓：<span class="mess" id="CarDpMess">${sessionScope.CarDpMess}</span></div>
        <div style="width: 380px;margin-left: 170px;margin-top: 40px;">
            <table class="dt" border="0" cellspacing="1">
                <tr>
                    <th>序号</th>
                    <th>类别编码</th>
                    <th>类名名称</th>
                    <th>修改</th>
                    <th>删除</th>
                </tr>
                <c:forEach items="${sessionScope.ac.data}" var="record" varStatus="rows">
                    <tr>
                        <td>${(ac.pageNo-1)*ac.pageSize+rows.count}</td>
                        <td>${record.gid}</td>
                        <td>${record.gname}</td>
                        <td><a href="${webroot}/Pformation/category.do?id=${record.gid}&ainto=update1">修改</a></td>
                        <td><a href="${webroot}/Pformation/category.do?id=${record.gid}&ainto=delete">删除</a></td>
                    </tr>
                </c:forEach>
            </table>
            <div class="pagenav">${sessionScope.ac.pageNav}</div>
        </div>
        <div class="operation" style="margin-left: 10px;padding-top: 10px;width: 200px;">验证添加信息↓：<span class="mess" id="CarpMess">${sessionScope.CarpMess}</span></div>
        <div style="margin-left: 30px;margin-top: 20px;">
            <el-input v-model="input" placeholder="商品类别" style="width: 100px;"></el-input>
            <el-input v-model="input1" placeholder="商品名称" style="width: 100px;"></el-input>
            <el-button type="primary" plain style="width: 80px;" @click="tj()">添加</el-button>
        </div>
        <div class="operation" style="margin-left: 10px;padding-top: 10px;width: 200px;">验证修改信息↓：<span class="mess" id="CarUpMess">${sessionScope.CarUpMess}</span></div>
        <div style="margin-left: 30px;margin-top: 20px;">
                <input type="text" placeholder="商品类别" style="width: 100px;" value="${sessionScope.goods.gid}" id="idd" name="idd" readonly>
                <input type="text" placeholder="商品名称" style="width: 100px;" value="${sessionScope.goods.gname}" id="namee" name="namee">
                <el-button type="primary" plain style="width: 80px;" @click="xg()">修改</el-button>
        </div>
    </div>
</div>
</body>
<style>
    #app {
        width: 1280px;
        margin: 0 auto;
    }
    a{
        text-decoration: none;
    }
</style>
<script>
    new Vue({
        el:'#app',
        data:{
            input:"",
            input1:""
        },
        methods: {
            tj(){
                var log = {
                    id: this.input,
                    name: this.input1
                }
                window.location.href="${webroot}/Pformation/category.do?ainto=add&c=" + JSON.stringify(log)
            },
            xg(){
                var log ={
                    id: document.getElementById("idd").value,
                    name:document.getElementById("namee").value
                }
                window.location.href="${webroot}/Pformation/category.do?ainto=update&c=" + JSON.stringify(log)
            }
        },


    })
</script>
</html>
